xen: credit2: optimize runq_candidate() a little bit
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 29 Aug 2017 09:18:52 +0000 (10:18 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 29 Aug 2017 09:18:52 +0000 (10:18 +0100)
commit8c271ba070e05d63998ea86e0d70f76c2422ad54
tree6efae313a918cf12827821151f2ff1dcab0aab1d
parentafd44e2acab5bdc6a62120b21e5c7e4b80919db1
xen: credit2: optimize runq_candidate() a little bit

By factoring into one (at the top) all the checks
to see whether current is the idle vcpu, and mark
it as unlikely().

In fact, if current is idle, all the logic for
dealing with yielding, context switching rate
limiting and soft-affinity, is just pure overhead,
and we better rush checking the runq and pick some
vcpu up.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c